<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="https://cdn.staticfile.org/jquery/1.10.2/jquery.min.js"></script>
</head>
<body>
    <p>这是文本的内容 <b>这是标题</b></p>
    <button id="btn1">显示文字内容</button>
    <button id="btn2">显示HTML内容</button>
    <button id="name">显示输入框</button>
    <button id="attr">显示a标签的属性</button>
    <a href="www.baidu.com"></a>
    <input type="text" placeholder="请输入您的姓名">
    <script>
        $('#btn1').click(function () {
            alert($('p').text());
        })
        $('#btn2').click(function () {
            alert($('p').html());
        })
        $('#name').click(function () {
            alert($('input').val());
        })
        $('#attr').click(function () {
            alert($('a').attr('href'));
        })
    </script>
</body>
</html>